<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="includes/js/jquery-1.10.0.min.js" type="text/javascript"></script>
</head>
<body>
<input type="button" value="从sqlserver导入到mysql" id="hit" onclick="_hit()" />
<input type="button" value="生成试题短标题" id="shortTitle" onclick="_shortTitle()" />
<input type="button" value="lucene创建EXAM索引"  onclick="createIndex('exam')" />
<input type="button" value="lucene创建PAPER索引"  onclick="createIndex('paper')" />
<br />
<br />
<input type="text" id="keyword" />
<input type="button" value="搜索"  onclick="_search()" />
<div id="content"> </div>

<script type="text/javascript">
	function _shortTitle(){
		$.ajax({
			type:"POST",
			cache:false,
			url:"HomePageServlet",
	    	success:function(msg){
	    		if (msg) $("#content").append('<div>' + msg + '</div>');
			}
		}); 
	}
	
	function _hit(){
		$.ajax({
			type:"GET",
			cache:false,
			url:"HomePageServlet",
	    	success:function(msg){
	    		if (msg) $("#content").append('<div>' + msg + '</div>');
			}
		}); 
	}
	
	function createIndex(type){
		$.ajax({
			type:"POST",
			cache:false,
			url:"LuceneIndexServlet",
			data:{type: type},
	    	success:function(msg){
	    		if (msg) $("#content").append('<div>' + msg + '</div>');
			}
		}); 
	}
	
	
	function _search(){
		var keyword = $('#keyword').val();
		$.ajax({
			type:"POST",
			cache:false,
			url:"SimpleSearchServlet",
			data:{keyword: keyword},
	    	success:function(msg){
	    		if (msg) $("#content").append('<div>' + msg + '</div>');
			}
		}); 
	}
</script>
<!--统计-->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-665718-7', 'tihai.org');
  ga('send', 'pageview');

</script>
</body>
</html>